import React from 'react';

import './index.less';
import {render, connect} from '../../../../../hrpub/common/frame';


import {base} from 'nc-lightapp-front';

import ExecAction from './actions';
import RowHandle from '../../actions/rowHandle';

const {
    NCModal,
    NCDatePicker,
    NCButton
} = base;

const {
    Header,
    Body,
    Footer
} = NCModal;

const Wrapper = render({
    actions: {
        execA: ExecAction,
        rowAct: RowHandle
    }
})(({state, action, props}) => {

    const {emp} = props;

    return (
        <NCModal
            show={emp.executeModalVisible}
            onHide={action.execA.closeModal}
            size="sm"
        >
            <Header
                closeButton={true}
            >
                {emp.language['gx6008-000099']/** 生效日期 */}
            </Header>
            <Body>
                <div className="execute-modal-content">
                    <label>{emp.language['gx6008-000099']/** 生效日期 */}</label>
                    <span>
                        <NCDatePicker
                            value={emp.executeModalApplyDate}
                            onChange={action.execA.changeDate}
                        />
                    </span>
                </div>
            </Body>
            <Footer>
                <NCButton
                    colors="primary"
                    onClick={action.rowAct.executeBill}
                >
                    {emp.language['gx6008-000024']/** 确定 */}
                </NCButton>
                <NCButton
                    onClick={action.rowAct.closeExecuteModal}
                >
                    {emp.language['gx6008-000025']/** 取消 */}
                </NCButton>
            </Footer>
        </NCModal>
    );

});


export default connect(Wrapper);